﻿namespace JumpJump.Tools
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    class Program
    {
        static Dictionary<string, string> Arguments = new Dictionary<string, string>();

        static void Main(string[] args)
        {
            GetArguments(args);
            Process();
        }

        static void GetArguments(string[] args)
        {
            for (int i = 0; i < args.Length; i += 2)
            {
                string key = args[i].Substring(1, args[i].Length - 1).ToLower();
                string value = args[i + 1].ToLower();
                Arguments.Add(key, value);
            }
        }

        static void Process()
        {
            string mode = Arguments["mode"];

            switch (mode)
            { 
                case "convertatorep":
                    AtoHelper.Process(Arguments["infilefolder"], Arguments["outfilefolder"]);
                    break;
                case "mergechessmanual":
                    string inFileFolder = Arguments["infilefolder"];
                    string outFileFolder = Arguments["outfilefolder"];
                    ChessManualHelper.GenerateDat(inFileFolder, outFileFolder);
                    break;
            }
        }
    }
}
